package demoMod.stsconsole.monsters.exordium;

import demoMod.stsconsole.helpers.DamageInfo;
import demoMod.stsconsole.monsters.AbstractMonster;
import demoMod.stsconsole.powers.AngerPower;
import demoMod.stsconsole.powers.VulnerablePower;

public class GremlinNob extends AbstractMonster {
    public static final String ID = "GremlinNob";

    public GremlinNob() {
        super(ID);
        this.setHp(88, 91);
        this.damage.add(new DamageInfo(8, this));
        this.damage.add(new DamageInfo(16, this));
        this.type = EnemyType.ELITE;
    }

    @Override
    protected void getMove(int aiRng) {
        if (firstMove) {
            setMove(0, Intent.BUFF);
            firstMove = false;
        } else {
            if (lastMove(0) || lastTwoMoves(2)) {
                setMove(1, Intent.ATTACK_DEBUFF, this.monsterStrings.get(2),this.damage.get(0));
            } else {
                setMove(2, Intent.ATTACK, this.damage.get(1));
            }
        }
    }

    @Override
    public void takeTurn() {
        switch (this.nextMove) {
            case 0:
                this.talk(this.monsterStrings.get(1));
                this.applyPower(this, new AngerPower(this, 2));
                break;
            case 1:
                this.defaultTarget.damage(this.damage.get(0));
                this.defaultTarget.applyPower(this, new VulnerablePower(this.defaultTarget, 2));
                break;
            case 2:
                this.defaultTarget.damage(this.damage.get(1));
                break;
        }
        getMove(0);
    }
}
